//
//  WaitingSingleShow.h
//  WaitingSingleShow-Demo
//
//  Created by telen on 12-11-1.
//  Copyright (c) 2012年 刘赞黄Telen. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

#define WaitShowIntervalTime 3.f
#define HideAnimationTime 0.8f
#define Radius 3.f
#define Pad 18.f
#define Alpha 0.6f
#define SizeOfFont 15.f
#define TopImageWidth 50.f
#define TopImageHeight 50.f
#define TopStrWidth 150.f
#define TopSrtHeight 200.f
#define centerOffsetMultiplyWidth (0.f)
#define centerOffsetMultiplyHeight (-1/6.f)
//-----------

@protocol WaitingShowDelegate <NSObject>
@optional
-(void)WaitingShow_AutoLayoutCaseView:(UIView*)caseView withWeihtHeight:(CGSize)size;

@end

//父视图移除子视图协议
@protocol CoverViewDelegate <NSObject>
@optional
-(void)CoverViewDidRemovedFromSuperView;
@end

//覆盖视图
@interface CoverView : UIView
@property (nonatomic,assign) id<CoverViewDelegate> deletegate;
@end

@interface WaitingShow : NSObject<CoverViewDelegate>{
    UIView* _topSubView;
    UILabel* _txtlabel;
    UIView* _caseView;
    CoverView* _view;
    NSTimer * _hideTimer;
    UIView* defaultWindow;
}
@property (nonatomic,retain) UIFont * textFont;         // 默认系统字体 16 号
@property (nonatomic,retain) UIImage * image;           // 默认没有图片 或者 加载动画
@property (nonatomic,assign) CGSize imageSize;          // 默认50*50
@property (nonatomic,assign) CGPoint centerOffset;            // 默认居中
@property (nonatomic,assign) BOOL notToSaveAttr;        // 默认为yes，不保存属性设置
@property (nonatomic,assign) BOOL touchScreenHide;      // 默认为no，触摸不隐藏
@property (nonatomic,assign) BOOL toQueueArr;           // 默认为yes，进入队列末尾
@property (nonatomic,assign) BOOL removalDuplication;   // 默认为yes, 去除重复消息
@property (retain) NSMutableArray * queueArr;
@property (nonatomic,readonly) BOOL isShowing;          // 实时状态
@property (nonatomic,assign) id<WaitingShowDelegate> delegate;

//获取单例
+ (WaitingShow*)shareSingleShow;
- (void)setDefaultWindow:(UIView*)v;
//
+ (id)createInstance;

//隐藏Show
- (void)hideShow;//渐变隐藏
- (void)hideShowRightNow;//立即隐藏
- (void)hideShowWithIntervalTime:(CGFloat)intervaltime;

//显示文本，支持\n换行 根据属性匹配文字样式 显示加载动画
//window上
- (void)showWaitingString:(NSString*)str;
//指定superView
- (void)showWaitingString:(NSString*)str inSuperView:(UIView*)superView;

//显示文本，支持\n换行 根据属性匹配文字样式和图片
//window上
- (void)showString:(NSString*)str andAutoHide:(BOOL)yesOrNo;
- (void)showString:(NSString*)str withIntervalTime:(CGFloat)intervaltime;//intervaltime <= 0不隐藏
//指定superView
- (void)showString:(NSString*)str inSuperView:(UIView*)superView andAutoHide:(BOOL)yesOrNo;
- (void)showString:(NSString*)str inSuperView:(UIView*)superView withIntervalTime:(CGFloat)intervaltime;//intervaltime <= 0不隐藏

//动态修改图片及文字
- (void)changeShowingSting:(NSString*)str withAnimation:(BOOL)yesOrNo;
- (void)changeShowingImage:(UIImage*)image withAnimation:(BOOL)yesOrNo;

//录音等待框
- (void)showSoundRecordingString:(NSString*)str inSuperView:(UIView*)superView;

//显示图片对错
//window上
- (void)showSuccessString:(NSString*)str autoHideTime:(CGFloat)intervaltime;//intervaltime <= 0不隐藏
- (void)showFailString:(NSString*)str autoHideTime:(CGFloat)intervaltime;//intervaltime <= 0不隐藏
//指定superView
- (void)showSuccessString:(NSString*)str inSuperView:(UIView*)superView autoHideTime:(CGFloat)intervaltime;//intervaltime <= 0不隐藏
- (void)showFailString:(NSString*)str inSuperView:(UIView*)superView autoHideTime:(CGFloat)intervaltime;//intervaltime <= 0不隐藏

//等待后，对错提醒 图片为65*50
- (void)didFinshWaitingShowSuccessString:(NSString*)str autoHideTime:(CGFloat)intervaltime;//intervaltime <= 0不隐藏
- (void)didFinshWaitingShowFailString:(NSString*)str autoHideTime:(CGFloat)intervaltime;//intervaltime <= 0不隐藏

//自带图片show
- (void)showImageWithName:(NSString*)name withString:(NSString*)str autoHideTime:(CGFloat)intervaltime;//intervaltime <= 0不隐藏

@end


@interface UIAlertView (MSG_WaittingShow)

+ (void)showAluertMessage:(NSString *)msg title:(NSString*)title sureBtn:(NSString*)btn;

@end


//
